<template>
	<Modal class-name="download-modal" v-model="visible" :closable="false" :mask-closable="false" :footer-hide="true">
		<div class="content">
			<p>最新版本已下载完成</p>
		</div>
		<div class="footer">
			<Button class="btn btn-default" type="default" @click="cancelHandle">取消</Button>
			<Button class="btn" type="primary" @click="initHandle">立即安装</Button>
		</div>
	</Modal>
</template>
<script>
export default {
	props: {
		value: {
			type: Boolean,
			default: false
		},
		data: {
			type: Object,
			default: () => {}
		}
	},
	watch: {
		value(val) {
			this.visible = val
		}
	},
	computed: {
		visible: {
			get() {
				return this.value
			},
			set(val) {
				this.$emit('input', val)
			}
		}
	},
	data() {
		return {}
	},
	methods: {
		cancelHandle() {
			this.visible = false
			chrome.webview.hostObjects.form.OnPageEvent('cancel')
		},
		initHandle() {
			chrome.webview.hostObjects.form.OnPageEvent('install')
		}
	}
}
</script>
<style lang="less" scoped>
/deep/.ivu-modal {
	width: 31.88rem !important ;
	top: 3.5rem;
}
/deep/.ivu-modal-header {
	border: 0 !important;
}
/deep/.ivu-modal-footer {
	border: 0;
}
/deep/.ivu-modal-content {
	border-radius: 1rem;
	padding: 2.5rem 0 2.6rem 0;
}

// /deep/.ivu-modal-wrap {
// 	display: flex;
// 	justify-content: space-around;
// 	overflow: hidden;
// }

.download-modal {
	// .modal-header {
	// 	height: 24px;
	// 	line-height: 24px;
	// }
	.content {
		p {
			text-align: center;
			font-family: PingFangSC-Semibold;
			font-size: 1.13rem;
			color: var(--setting-text-title-color);
			letter-spacing: 0;
			font-weight: 600;
			margin-bottom: 2.5rem;
		}
	}
	.footer {
		text-align: center !important;
		/deep/.ivu-btn span {
			font-family: PingFangSC-Semibold;
			font-size: 1.13rem;
			letter-spacing: 0;
			line-height: 2rem;
		}
		/deep/.ivu-btn-default {
			background: #c6c6c6;
			&:hover {
				border: 1px solid transparent;
			}
			span {
				color: #fff;
			}
		}
	}
	.btn {
		margin-right: 1.2rem;
		border-radius: 1.8rem;
		padding: 0.5rem 2.05rem 0.5rem 2.05rem;
		height: 3rem;
		font-weight: 600;
	}
}
</style>
